<?php
namespace app\index\controller;

use app\common\model\Cate as CateModel;

/**
 * 分类控制器
 * Class Index
 * @package app\index\controller
 */
class Cate extends Base
{
    /**
     * [index  分类数据]
     * @return json
     * @author [C。]
     */
    public function index()
    {
        $param = input('param.');
        $user = $this->user;
        $model = new CateModel;
        $map = [];
        try{
            $map['states'] = 1;
            $map['class_id'] = $param['class_id'];
            $cate = $model->getAllData($map,'id','id,cname');
        }catch (\Exception $e) {
            systembug($e->getMessage(),3,$this->url);
            return admin_json(-1,$e->getMessage());
        }
        return admin_json(1,'获取成功',$cate);
    }
}